package com.digitalchina.lxnsy.api;

import android.app.Activity;
import android.os.Handler;

import com.digitalchina.lxnsy.constant.MSG;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.OkHttpUtil;
import com.digitalchina.lxnsy.xml.AdminXML;
import com.digitalchina.lxnsy.xml.LocationXML;
import com.digitalchina.lxnsy.xml.UserXML;
import com.lzy.okhttputils.model.HttpParams;

import java.util.Map;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.api
 * 创建人：郑皓
 * 创建时间：2018/8/22 14:51
 * 修改备注：
 * ================================================
 */
public class BusinessPlan {


    /**
     * 新增计划任务
     * <p>
     * planTypeCode = ""; // 计划类型CODE
     * cropTypeCode = ""; // 农作物信息Code
     * cropKindCode = ""; // 农作物品种Code
     * seedDate = ""; // 播种时间 2018-08-22 蔬菜时必填
     * treeAge = ""; // 树龄 果树必填
     * plantSize = ""; // 种植面积
     * plantTypeCode = ""; // 栽培方式CODE 蔬菜时必填
     * provinceName = ""; // 省名称
     * cityName = ""; // 城市名称
     * countyName = ""; // 区名称
     * suitOrgId = ""; // 所属单位Id
     * productStandardId = ""; // 生产标准Id
     * farmOperationId = ""; // 农事操作阶段ID
     * planId = ""; // 生产计划ID（修改时，传入）
     */
    public static void addPlan(Activity activity, Map<String, String> map, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("planTypeCode", map.get("planTypeCode"));
        params.put("cropTypeCode", map.get("cropTypeCode"));
        params.put("cropKindCode", map.get("cropKindCode"));
        if (map.get("planTypeCode").equals("3001002"))
            params.put("seedDate", map.get("seedDate"));
        params.put("treeAge", map.get("treeAge"));
        params.put("plantSize", map.get("plantSize"));
        params.put("plantTypeCode", map.get("plantTypeCode"));
        params.put("provinceName", map.get("provinceName"));
        params.put("cityName", map.get("cityName"));
        params.put("countyName", map.get("countyName"));
        params.put("suitOrgId", map.get("suitOrgId"));
        params.put("productStandardId", map.get("productStandardId"));
        params.put("farmOperationId", map.get("farmOperationId"));
        params.put("planId", map.get("planId"));
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_ADD_PLAN, "", params, handler, MSG.MSG_ADD_PLAN_SUCCESS, MSG.MSG_ADD_PLAN_FIELD);

    }

    /**
     * 新增生产计划 v2
     *
     * @param activity
     * @param planId
     * @param seedDate          播种时间
     * @param plantSize         种植面积
     * @param suitOrgId         所属单位Id
     * @param productStandardId 生产标准Id
     * @param farmOperationId   农事操作阶段ID
     * @param handler
     */
    public static void addPlan(Activity activity, String planId, String seedDate, String plantSize, String suitOrgId, String productStandardId, String farmOperationId,
                               String landId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("planId", planId);
        params.put("seedDate", seedDate);
        params.put("plantSize", plantSize);
        params.put("suitOrgId", suitOrgId);
        params.put("productStandardId", productStandardId);
        params.put("farmOperationId", farmOperationId);
        params.put("landId", landId);
        params.put("userAccId", UserXML.getUserId(activity));
        if (AdminXML.getFarmOperation(activity).equals("1")) {
            //ERP进入 传企业ID
            params.put("enterpriseId", AdminXML.getEnterpriseId(activity));
        }

        OkHttpUtil.post(activity, URL.URL_ADD_PLAN, "", params, handler, MSG.MSG_ADD_PLAN_SUCCESS, MSG.MSG_ADD_PLAN_FIELD);

    }


    /**
     * 删除计划任务
     *
     * @param activity
     * @param planId
     * @param handler
     */
    public static void deletePlan(Activity activity, String planId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("planId", planId);

        OkHttpUtil.post(activity, URL.URL_DELETE_PLAN, "", params, handler, MSG.MSG_DELETE_PLAN_SUCCESS, MSG.MSG_DELETE_PLAN_FIELD);

    }


    /**
     * 计划任务列表
     *
     * @param activity
     * @param page
     * @param limit
     * @param handler
     */
    public static void getPlanList(Activity activity, int page, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("page", String.valueOf(page));
        params.put("limit", String.valueOf(limit));
        if (AdminXML.getFarmOperation(activity).equals("1")) {
            //ERP进入 传企业ID
            params.put("enterpriseId", AdminXML.getEnterpriseId(activity));
        }

        OkHttpUtil.post(activity, URL.URL_GET_PLAN_LIST, "", params, handler, MSG.MSG_GET_PLAN_LIST_SUCCESS, MSG.MSG_GET_PLAN_LIST_FIELD);

    }


    /**
     * 获取农作物信息，栽培方式，农作物品种基础数据
     *
     * @param activity
     * @param handler
     */
    public static void getOpts(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();

        OkHttpUtil.post(activity, URL.URL_GET_PLAN_OPTS, "", params, handler, MSG.MSG_GET_PLAN_OPTS_SUCCESS, MSG.MSG_GET_PLAN_OPTS_FIELD);

    }


    /**
     * 获取种植标准接口
     *
     * @param activity
     * @param cropType        蔬菜 vegetable 果树 fruitTree
     * @param suitCropCode    农作物信息CODE
     * @param suitGrowWayCode 栽培方式CODE（蔬菜时必填）
     * @param handler
     */
    public static void queryProductStandard(Activity activity, String cropType, String suitCropCode, String suitGrowWayCode, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("cropType", cropType);
        params.put("suitCropCode", suitCropCode);
        params.put("suitGrowWayCode", suitGrowWayCode);

        OkHttpUtil.post(activity, URL.URL_QUERY_PRODUCT_STANDARD, "", params, handler, MSG.MSG_QUERY_PRODUCT_STANDARD_SUCCESS, MSG.MSG_QUERY_PRODUCT_STANDARD_FIELD);

    }

    /**
     * 今日推荐
     *
     * @param activity
     * @param planId
     * @param handler
     */
    public static void todayRecommend(Activity activity, String planId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("planId", planId);
        params.put("limit", "3");

        OkHttpUtil.post(activity, URL.URL_TODAY_RECOMMEND, "", params, handler, MSG.MSG_TODAY_RECOMMEND_SUCCESS, MSG.MSG_TODAY_RECOMMEND_FIELD);

    }

    /**
     * 计划任务列表全部查询接口
     *
     * @param activity
     * @param handler
     */
    public static void getPlanAllList(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_GET_PLAN_ALL_LIST, "", params, handler, MSG.MSG_GET_PLAN_ALL_LIST_SUCCESS, MSG.MSG_GET_PLAN_ALL_LIST_FIELD);

    }

    /**
     * 获取7天天气
     *
     * @param activity
     * @param handler
     */
    public static void getCityWeatherList(Activity activity, String city, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("city", city);

        OkHttpUtil.post(activity, URL.URL_GET_CITY_7DAYS_WEATHER, "", params, handler, MSG.MSG_GET_CITY_7DAYS_WEATHER_SUCCESS, MSG.MSG_GET_CITY_7DAYS_WEATHER_FIELD);

    }


    /**
     * 生产计划（列表）接口  (物候期)
     *
     * @param activity
     * @param productionId
     * @param handler
     */
    public static void productionShow(Activity activity, String productionId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);

        OkHttpUtil.post(activity, URL.URL_PRODUCTION_SHOW, "", params, handler, MSG.MSG_PRODUCTION_SHOW_SUCCESS, MSG.MSG_PRODUCTION_SHOW_FIELD);

    }


    /**
     * 标准关联的专家列表查询
     *
     * @param activity
     * @param productStandardId 标准ID
     * @param offset
     * @param limit
     * @param handler
     */
    public static void getExperts(Activity activity, String productStandardId, int offset, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productStandardId", productStandardId);
        params.put("offset", String.valueOf(offset));
        params.put("limit", String.valueOf(limit));

        OkHttpUtil.post(activity, URL.URL_PLAN_GET_EXPERTS, "", params, handler, MSG.MSG_PLAN_GET_EXPERTS_SUCCESS, MSG.MSG_PLAN_GET_EXPERTS_FIELD);

    }

    /**
     * 生产计划完成接口
     *
     * @param activity
     * @param productionId    生产计划id
     * @param farmOperationId 农事操作Id
     * @param handler
     */
    public static void operationCompleted(Activity activity, String productionId, String farmOperationId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);
        params.put("farmOperationId", farmOperationId);

        OkHttpUtil.post(activity, URL.URL_OPERATION_COMPLETED, "", params, handler, MSG.MSG_OPERATION_COMPLETED_SUCCESS, MSG.MSG_OPERATION_COMPLETED_FIELD);

    }

    /**
     * 农事记录列表
     * +
     *
     * @param activity
     * @param productionId 生产计划id
     * @param page
     * @param limit
     * @param handler
     */
    public static void farmingList(Activity activity, String productionId, int page, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);
        params.put("page", String.valueOf(page));
        params.put("limit", String.valueOf(limit));

        OkHttpUtil.post(activity, URL.URL_FARMING_LIST_NEW, "", params, handler, MSG.MSG_FARMING_LIST_SUCCESS, MSG.MSG_FARMING_LIST_FIELD);

    }


    /**
     * 获取农药化肥基础数据
     *
     * @param activity
     * @param handler
     */
    public static void getPesticideData(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();

        OkHttpUtil.post(activity, URL.URL_GET_PESTICIDE_DATA, "", params, handler, MSG.MSG_GET_PESTICIDE_DATA_SUCCESS, MSG.MSG_GET_PESTICIDE_DATA_FIELD);

    }


    /**
     * 农事记录保存编辑接口
     *
     * @param productionId            生产计划Id
     * @param cropType                0作物管理 1用肥用药
     * @param operationDate           操作日期
     * @param weather                 天气
     * @param weatherDescribe         天气描述
     * @param phId                    物后期Id
     * @param phaseName               物后期name
     * @param farmingOperations       农事操作Id 当cropType为0时必传
     * @param farmingOperationsimgs   图片多个以，隔开
     * @param specification           补充说明
     * @param perMuTotal              亩数总量
     * @param waterTotal              兑水总量
     * @param pesticideFertilizerList 农事记录管理农药、肥料Json字符串
     * @param id                      农事记录Id
     */
    public static void farmingSave(Activity activity, String productionId, String cropType, String operationDate, String weather, String weatherDescribe,
                                   String phId, String phaseName, String farmingOperations, String farmingOperationsimgs, String specification, String perMuTotal,
                                   String waterTotal, String pesticideFertilizerList, String id, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("cropType", cropType);
        params.put("operationDate", operationDate);
        params.put("weather", weather);
        params.put("weatherDescribe", weatherDescribe);
        params.put("phId", phId);
        params.put("phaseName", phaseName);
        params.put("farmingOperationsimgs", farmingOperationsimgs);
        params.put("specification", specification);
        params.put("id", id);

        if (cropType.equals("0")) {
            params.put("farmingOperations", farmingOperations);
        } else {
            params.put("perMuTotal", perMuTotal);
            params.put("waterTotal", waterTotal);
            params.put("pesticideFertilizerList", pesticideFertilizerList);
        }

        OkHttpUtil.post(activity, URL.URL_FARMING_SAVE, "", params, handler, MSG.MSG_FARMING_SAVE_SUCCESS, MSG.MSG_FARMING_SAVE_FIELD);

    }

    public static void farmingSaveV2(Activity activity, String productionId, String operationDate, String weather, String weatherDescribe,
                                     String phId, String phaseName, String farmingOperations, String farmingOperationsimgs, String specification, String perMuTotal,
                                     String pesticideFertilizerList, String id, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("operationDate", operationDate);
        params.put("weather", weather);
        params.put("weatherDescribe", weatherDescribe);
        params.put("phId", phId);
        params.put("phaseName", phaseName);
        params.put("farmingOperationsimgs", farmingOperationsimgs);
        params.put("specification", specification);
        params.put("id", id);

        params.put("farmingOperations", farmingOperations);
        params.put("perMuTotal", perMuTotal);
        params.put("pesticideFertilizerList", pesticideFertilizerList);

        OkHttpUtil.post(activity, URL.URL_FARMING_SAVE, "", params, handler, MSG.MSG_FARMING_SAVE_SUCCESS, MSG.MSG_FARMING_SAVE_FIELD);

    }

    /**
     * enterpriseId		企业ID
     * productionId		计划Id
     * operationDate	日期 yyyy-MM-dd
     * weather		    天气温度
     * weatherDescribe		天气描述
     * phId		            物候期ID
     * farmingOperationId	农事操作ID
     * farmingOperationsimgs		图片 ,号分割多张图片
     * specification		补充说明
     * muNumber		    亩数
     * hours		    工时
     * peopleNum		人数
     * member		    社员
     * varietyId		品种ID
     * landParcelInfoId		地块ID
     * schemaList		json字符串 所有操作字段集合
     * id		        农事记录ID 修改时填写
     * userAccId		用户ID
     */
    public static void farmingSaveV3(Activity activity, String productionId, String landParcelInfoId, String varietyId, String operationDate, String weather,
                                     String weatherDescribe, String phId, String phaseName, String farmingOperationId,
                                     String muNumber, String hours, String peopleNum, String member,
                                     String farmingOperationsimgs, String specification,
                                     String schemaList, String id, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productionId", productionId);

        params.put("landParcelInfoId", landParcelInfoId);
        params.put("varietyId", varietyId);
        params.put("operationDate", operationDate);
        params.put("weather", weather);
        params.put("weatherDescribe", weatherDescribe);
        params.put("phId", phId);
        params.put("phaseName", phaseName);


        params.put("farmingOperationId", farmingOperationId);
        params.put("muNumber", muNumber);
        params.put("hours", hours);
        params.put("peopleNum", peopleNum);
        params.put("member", member);

        params.put("farmingOperationsimgs", farmingOperationsimgs);
        params.put("specification", specification);

        params.put("schemaList", schemaList);

        params.put("id", id);
        params.put("userAccId", UserXML.getUserId(activity));

        if (AdminXML.getFarmOperation(activity).equals("1")) {
            //ERP进入 传企业ID
            params.put("enterpriseId", AdminXML.getEnterpriseId(activity));
        }

        OkHttpUtil.post(activity, URL.URL_FARMING_SAVE_NEW, "保存中...", params, handler, MSG.MSG_FARMING_SAVE_SUCCESS, MSG.MSG_FARMING_SAVE_FIELD);

    }


    /**
     * 农事记录删除
     *
     * @param activity
     * @param farmId   农事记录Id
     * @param handler
     */
    public static void farmingDelete(Activity activity, String farmId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("farmId", farmId);

        OkHttpUtil.post(activity, URL.URL_FARMING_DELETE, "", params, handler, MSG.MSG_FARMING_DELETE_SUCCESS, MSG.MSG_FARMING_DELETE_FIELD);

    }


    /**
     * 新增停留时长
     *
     * @param activity
     * @param planId     计划ID
     * @param stayType   类型（0=农事、1=记账）
     * @param inTime     进入时间
     * @param faroutTime 农事保存退出时间
     * @param outTime    离开时间(通用)
     * @param handler
     */
    public static void saveStayOftenInfo(Activity activity, String planId, String stayType, String inTime, String faroutTime, String outTime, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("planId", planId);
        params.put("stayType", stayType);
        params.put("inTime", inTime);
        params.put("faroutTime", faroutTime);
        params.put("outTime", outTime);

        OkHttpUtil.post(activity, URL.URL_SAVE_STAY_OFTEN_INFO, "", params, handler, MSG.MSG_SAVE_STAY_OFTEN_INFO_SUCCESS, MSG.MSG_SAVE_STAY_OFTEN_INFO_FIELD);

    }


    /**
     * 新增、编辑记账
     *
     * @param activity
     * @param id              记账id
     * @param type            0-收入 1-支出
     * @param productPlanId   计划ID
     * @param accountTypeCode 记账类型code
     * @param accountDate     账单日期 2018-07-30
     * @param money           记账金额
     * @param remark          备注
     * @param images          图片(以,隔开)
     * @param handler
     */
    public static void saveFarmAccount(Activity activity, String id, String type, String productPlanId, String accountTypeCode, String accountDate, String money,
                                       String remark, String images, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("id", id);
        params.put("type", type);
        params.put("productPlanId", productPlanId);
        params.put("accountTypeCode", accountTypeCode);
        params.put("accountDate", accountDate);
        params.put("money", money);
        params.put("remark", remark);
        params.put("images", images);

        OkHttpUtil.post(activity, URL.URL_SAVE_FARM_ACCOUNT, "", params, handler, MSG.MSG_SAVE_FARM_ACCOUNT_SUCCESS, MSG.MSG_SAVE_FARM_ACCOUNT_FIELD);

    }


    /**
     * 删除记账
     *
     * @param activity
     * @param id       记账id
     * @param handler
     */
    public static void deleteFarmAccount(Activity activity, String id, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("id", id);

        OkHttpUtil.post(activity, URL.URL_DELETE_FARM_ACCOUNT, "", params, handler, MSG.MSG_DELETE_FARM_ACCOUNT_SUCCESS, MSG.MSG_DELETE_FARM_ACCOUNT_FIELD);

    }


    /**
     * 记账明细列表
     *
     * @param activity
     * @param productPlanId 计划ID
     * @param accountDate   账单日期 格式：2018-07
     * @param page
     * @param limit
     * @param handler
     */
    public static void farmAccountDetailed(Activity activity, String productPlanId, String accountDate, int page, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productPlanId", productPlanId);
        params.put("accountDate", accountDate);
        params.put("page", String.valueOf(page));
        params.put("limit", String.valueOf(limit));

        OkHttpUtil.post(activity, URL.URL_FARM_ACCOUNT_DETAILED, "", params, handler, MSG.MSG_FARM_ACCOUNT_DETAILED_SUCCESS, MSG.MSG_FARM_ACCOUNT_DETAILED_FIELD);

    }

    /**
     * 记账统计
     *
     * @param activity
     * @param productPlanId 计划ID
     * @param accountDate   账单日期 格式：2018-07
     * @param type          收入支出类型 0-收入 1-支出
     * @param handler
     */
    public static void farmAccountStatistics(Activity activity, String productPlanId, String accountDate, String type, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("productPlanId", productPlanId);
        params.put("accountDate", accountDate);
        params.put("type", type);

        OkHttpUtil.post(activity, URL.URL_FARM_ACCOUNT_STATISTICS, "", params, handler, MSG.MSG_FARM_ACCOUNT_STATISTICS_SUCCESS, MSG.MSG_FARM_ACCOUNT_STATISTICS_FIELD);

    }

    /**
     * 查询用户计划数 返回0或大于0的数字
     *
     * @param activity
     * @param handler
     */
    public static void getPlanCountByUser(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_GET_PLAN_COUNT_BY_USER, "请稍候...", params, handler, MSG.MSG_GET_PLAN_COUNT_BY_USER_SUCCESS, MSG.MSG_GET_PLAN_COUNT_BY_USER_FIELD);

    }


    /**
     * 获取种植标准接口
     *
     * @param activity
     * @param provinceName
     * @param cityName
     * @param countyName
     * @param cropTypeCode 一级农作物分类
     * @param suitCropCode 二级农作物分类
     * @param handler
     */
    public static void queryProductStandardV2(Activity activity, String provinceName, String cityName, String countyName, String cropTypeCode, String suitCropCode, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("provinceName", provinceName);
        params.put("cityName", cityName);
        params.put("countyName", countyName);
        params.put("cropTypeCode", cropTypeCode);
        params.put("suitCropCode", suitCropCode);
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_QUERY_PRODUCT_STANDARD, "", params, handler, MSG.MSG_QUERY_PRODUCT_STANDARD_SUCCESS, MSG.MSG_QUERY_PRODUCT_STANDARD_FIELD);

    }

    public static void queryProductStandardV2(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("provinceName", LocationXML.getProvince(activity));
        params.put("cityName", LocationXML.getCity(activity));
        params.put("countyName", LocationXML.getDistrict(activity));


        OkHttpUtil.post(activity, URL.URL_QUERY_PRODUCT_STANDARD, "", params, handler, MSG.MSG_QUERY_PRODUCT_STANDARD_SUCCESS, MSG.MSG_QUERY_PRODUCT_STANDARD_FIELD);

    }


    /**
     * 获取农作物信息（最新）
     *
     * @param activity
     * @param handler
     */
    public static void getCropClassification(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();

        OkHttpUtil.post(activity, URL.URL_GET_CROP_CLASSIFICATION, "", params, handler, MSG.MSG_GET_CROP_CLASSIFICATION_SUCCESS, MSG.MSG_GET_CROP_CLASSIFICATION_FIELD);

    }


    /**
     * 生产标准下单接口
     *
     * @param activity
     * @param plantId
     * @param totalPriceReal
     * @param isCurrency     是否开启农币付费 0开启，1不开启
     * @param handler
     */
    public static void placeOrder(Activity activity, String plantId, String totalPriceReal, String isCurrency, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("plantId", plantId);
        params.put("totalPriceReal", totalPriceReal);
        params.put("isCurrency", isCurrency);
        params.put("userAccId", UserXML.getUserId(activity));


        OkHttpUtil.post(activity, URL.URL_PLACE_ORDER, "请稍等", params, handler, MSG.MSG_PLACE_ORDER_SUCCESS, MSG.MSG_PLACE_ORDER_FIELD);

    }

    /**
     * 金额计算接口
     *
     * @param activity
     * @param plantId
     * @param isCurrency 是否开启农币付费 0开启，1不开启
     * @param handler
     */
    public static void getPaymentAmount(Activity activity, String plantId, String isCurrency, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("plantId", plantId);
        params.put("isCurrency", isCurrency);
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_GET_PAYMENT_AMOUNT, "", params, handler, MSG.MSG_GET_PAYMENT_AMOUNT_SUCCESS, MSG.MSG_GET_PAYMENT_AMOUNT_FIELD);

    }

    /**
     * 订单支付方式修改
     *
     * @param activity
     * @param orderNo
     * @param paymentMethod 0支付宝 1微信  必传
     * @param handler
     */
    public static void updateOrder(Activity activity, String orderNo, String paymentMethod, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("orderNo", orderNo);
        params.put("paymentMethod", paymentMethod);

        OkHttpUtil.post(activity, URL.URL_UPDATE_ORDER, "请稍等", params, handler, MSG.MSG_UPDATE_ORDER_SUCCESS, MSG.MSG_UPDATE_ORDER_FIELD);

    }
}
